﻿using System;
namespace PSE.Framework.Process
{
    public enum HierarchicalProcessType
    {
        Parent,
        Child
    }

    public interface IHierarchicalProcess : IDisposable
    {
        bool IsStarted { get; }
        string Name { get; }

        int ProcessId { get; }
        HierarchicalProcessType? ProcessType { get; }

        string FileName { get; }
        string Arguments { get; }

        string Domain { get; }
        string UserName { get; }

        bool? CheckParentIsAlive { get; }
        bool? CheckChildIsAlive { get; }

        Uri ServiceAddress { get; }
        IHierarchicalProcessManager ProcessManager { get; }

        void Initialize(HierarchicalProcessStartInfo startInfo, IHierarchicalProcessManager processManager);

        bool IsParentReleased { get; }
        void ReleaseParent();

        void ReleaseChild();

        event EventHandler Restarted;
        event EventHandler Closed;

        event EventHandler<ProcessExceptionEventArgs> CheckIsAliveException;
    }
}
